StoredLearningSession.CreateAttempt Method (PackageStore, UserItemIdentifier, ActivityPackageItemIdentifier, LoggingOptions)

Create an attempt on a specific package. The package must have already been added to LearningStore. Following this method, Start or MoveToActivity must be called in order to deliver the first activity.

Parent Type: StoredLearningSession

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public static StoredLearningSession CreateAttempt (
PackageStore packageStore,
UserItemIdentifier learnerId,
ActivityPackageItemIdentifier rootActivityId,
LoggingOptions loggingOptions

)

Parameters

packageStore

The store which contains files from the package associated with the attempt.

learnerId

The learner who is starting the attempt.

rootActivityId

The LearningStore id of the organization (ie, root activity) to be attempted.

loggingOptions

Value to indicate the level of logging requested during an attempt.

Return Value

Returns a session representing the new attempt. The AttemptStatus of the session will be Active.

Exceptions
Exception type Condition
ArgumentNullException

Thrown when packageStore, learnerId or rootActivityId parameters are null.

ArgumentOutOfRangeException

Thrown when loggingOptions does not contain a valid value.

LearningStoreItemNotFoundException

Thrown if the learnerId or rootActivityId do not represent valid objects in LearningStore.

Remarks

This method adds attempt information to LearningStore.

After creating the attempt, the caller must call Start or MoveToActivity to identify the first activity for delivery.